/* ========================================
   主题系统 - 20套主题配色方案
   ======================================== */

/* 主题变量定义 */
:root {
    --primary-color: #007bff;
    --primary-hover: #0056b3;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-card: #ffffff;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
    --sidebar-bg: #343a40;
    --sidebar-text: #ffffff;
}

/* 1. 默认蓝色主题 (Default Blue) */
[data-theme="default"] {
    --primary-color: #007bff;
    --primary-hover: #0056b3;
    --sidebar-bg: #007bff;
}

/* 2. 深邃紫 (Deep Purple) */
[data-theme="purple"] {
    --primary-color: #6f42c1;
    --primary-hover: #5a32a3;
    --sidebar-bg: #5a32a3;
}

/* 3. 翡翠绿 (Emerald) */
[data-theme="emerald"] {
    --primary-color: #10b981;
    --primary-hover: #059669;
    --sidebar-bg: #047857;
}

/* 4. 晨曦粉 (Rose) */
[data-theme="rose"] {
    --primary-color: #e11d48;
    --primary-hover: #be123c;
    --sidebar-bg: #9f1239;
}

/* 5. 天空蓝 (Sky) */
[data-theme="sky"] {
    --primary-color: #0ea5e9;
    --primary-hover: #0284c7;
    --sidebar-bg: #0369a1;
}

/* 6. 橙色日落 (Orange) */
[data-theme="orange"] {
    --primary-color: #f97316;
    --primary-hover: #ea580c;
    --sidebar-bg: #c2410c;
}

/* 7. 青色水波 (Cyan) */
[data-theme="cyan"] {
    --primary-color: #06b6d4;
    --primary-hover: #0891b2;
    --sidebar-bg: #0e7490;
}

/* 8. 紫罗兰 (Violet) */
[data-theme="violet"] {
    --primary-color: #8b5cf6;
    --primary-hover: #7c3aed;
    --sidebar-bg: #6d28d9;
}

/* 9. 品红 (Fuchsia) */
[data-theme="fuchsia"] {
    --primary-color: #d946ef;
    --primary-hover: #c026d3;
    --sidebar-bg: #a21caf;
}

/* 10. 琥珀金 (Amber) */
[data-theme="amber"] {
    --primary-color: #f59e0b;
    --primary-hover: #d97706;
    --sidebar-bg: #b45309;
}

/* 11. 石板灰 (Slate) */
[data-theme="slate"] {
    --primary-color: #475569;
    --primary-hover: #334155;
    --sidebar-bg: #1e293b;
}

/* 12. 森林绿 (Forest) */
[data-theme="forest"] {
    --primary-color: #15803d;
    --primary-hover: #166534;
    --sidebar-bg: #14532d;
}

/* 13. 深海蓝 (Ocean) */
[data-theme="ocean"] {
    --primary-color: #1e40af;
    --primary-hover: #1e3a8a;
    --sidebar-bg: #1e3a8a;
}

/* 14. 樱花粉 (Sakura) */
[data-theme="sakura"] {
    --primary-color: #ec4899;
    --primary-hover: #db2777;
    --sidebar-bg: #be185d;
}

/* 15. 薄荷绿 (Mint) */
[data-theme="mint"] {
    --primary-color: #14b8a6;
    --primary-hover: #0d9488;
    --sidebar-bg: #0f766e;
}

/* 16. 深红 (Crimson) */
[data-theme="crimson"] {
    --primary-color: #dc2626;
    --primary-hover: #b91c1c;
    --sidebar-bg: #991b1b;
}

/* 17. 靛蓝 (Indigo) */
[data-theme="indigo"] {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --sidebar-bg: #3730a3;
}

/* 18. 石灰绿 (Lime) */
[data-theme="lime"] {
    --primary-color: #65a30d;
    --primary-hover: #4d7c0f;
    --sidebar-bg: #3f6212;
}

/* 19. 玫瑰金 (Rose Gold) */
[data-theme="rosegold"] {
    --primary-color: #b45309;
    --primary-hover: #92400e;
    --sidebar-bg: #78350f;
}

/* 20. 午夜黑 (Midnight) */
[data-theme="midnight"] {
    --primary-color: #1f2937;
    --primary-hover: #111827;
    --sidebar-bg: #030712;
    --bg-primary: #1f2937;
    --bg-secondary: #111827;
    --bg-card: #374151;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --border-color: #4b5563;
}

/* 主题应用到各个元素 */
body {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

.card {
    background-color: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    box-shadow: var(--shadow) !important;
}

.card-header {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-bottom-color: var(--border-color) !important;
}

.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
}

.sidebar,
.navbar {
    background-color: var(--sidebar-bg) !important;
    color: var(--sidebar-text) !important;
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.8) !important;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.badge-primary {
    background-color: var(--primary-color) !important;
}

/* 表格主题 */
.table {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

.table thead {
    background-color: var(--primary-color) !important;
}

/* 表单主题 */
.form-control,
.form-select {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25) !important;
}

/* 模态框主题 */
.modal-content {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

.modal-header {
    background-color: var(--bg-card) !important;
    border-bottom-color: var(--border-color) !important;
}

.modal-footer {
    background-color: var(--bg-card) !important;
    border-top-color: var(--border-color) !important;
}

/* 下拉菜单主题 */
.dropdown-menu {
    background-color: var(--bg-card) !important;
    border-color: var(--border-color) !important;
}

.dropdown-item {
    color: var(--text-primary) !important;
}

.dropdown-item:hover {
    background-color: var(--bg-secondary) !important;
}

/* 徽章主题 */
.badge {
    background-color: var(--primary-color) !important;
}

/* 主题切换按钮样式 */
.theme-selector {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050;
}

.theme-toggle-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.theme-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.theme-panel {
    position: absolute;
    bottom: 60px;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    max-width: 320px;
    display: none;
}

.theme-panel.show {
    display: block;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.theme-option {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.theme-option:hover {
    transform: scale(1.05);
    border-color: var(--primary-color);
}

.theme-option.active {
    border-color: var(--primary-color);
    border-width: 3px;
}

.theme-option.active::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 0 0 3px rgba(0,0,0,0.5);
}

.theme-option-label {
    font-size: 11px;
    text-align: center;
    margin-top: 4px;
    color: var(--text-secondary);
}

/* 移动端优化 */
@media (max-width: 768px) {
    .theme-selector {
        bottom: 10px;
        right: 10px;
    }
    
    .theme-toggle-btn {
        width: 45px;
        height: 45px;
    }
    
    .theme-panel {
        max-width: 280px;
        right: -10px;
    }
    
    .theme-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .theme-option {
        width: 55px;
        height: 55px;
    }
}
